The present invention relates to a DCT processor which realizes discrete cosine transform (hereinafter referred to as DCT) used for data compression such as image signal processing and, more particularly, to a DCT processor which performs at least one of DCT operation and inverse DCT operation for image data in unit blocks having different sizes.
DCT is generally used for data compression of an image signal or the like. In data compression for video, generally, data compression utilizing intra-frame (spatial) correlation and data compression utilizing inter-frame (temporal) correlation are performed, and DCT corresponds to the former. DCT is a kind of frequency conversion method, that is, data compression is performed by removing high-frequency components utilizing the characteristics of pixel values such that relatively large pixel values concentrate on low-frequency components after conversion although pixel values disperse at random before conversion.
In DCT, initially, one image is divided into a plurality of unit blocks each having a predetermined shape and comprising a predetermined number of pixels (e.g., 8xc3x978), and DCT is performed on every unit block. Two-dimensional DCT is executed by performing one-dimensional DCT twice. For example, the result of one-dimensional DCT performed on a unit block along its column direction is subjected to one-dimensional DCT along its row direction.
Further, the image signal compressed by DCT is decompressed by inverse DCT.
Formulae (1) and (2) define two-dimensional DCT and two-dimensional inverse ICT for an Nxc3x97N unit block, respectively.                               X          ⁡                      (                          u              ,              v                        )                          =                              2            /            N                    ·                      C            ⁡                          (              u              )                                ·                      xe2x80x83                    ⁢                      C            ⁢                          xe2x80x83                        (            v            )                    ·                                    ∑                              i                =                0                                            N                -                1                                      ⁢                          xe2x80x83                        ⁢                                          ∑                                  j                  =                  0                                                  N                  -                  1                                            ⁢                              xe2x80x83                            ⁢                                                x                  ⁡                                      (                                          i                      ,                      j                                        )                                                  ⁢                                  xe2x80x83                                ⁢                cos                ⁢                                  xe2x80x83                                ⁢                                  (                                                            (                                                                        2                          ⁢                          i                                                +                        1                                            )                                        ⁢                    u                    ⁢                                          xe2x80x83                                        ⁢                                          π                      /                      2                                        ⁢                    N                                    )                                ⁢                cos                ⁢                                  xe2x80x83                                ⁢                                  (                                                            (                                                                        2                          ⁢                          j                                                +                        1                                            )                                        ⁢                    v                    ⁢                                          xe2x80x83                                        ⁢                                          π                      /                      2                                        ⁢                    N                                    )                                "AutoLeftMatch"                                                                        formula        ⁢                  xe2x80x83                ⁢                  (          1          )                                                  x          ⁡                      (                          i              ,              j                        )                          =                              2            /            N                    ·                                    ∑                              u                =                0                                            N                -                1                                      ⁢                          xe2x80x83                        ⁢                                          ∑                                  v                  =                  0                                                  N                  -                  1                                            ⁢                              xe2x80x83                            ⁢                                                                    ·                                          C                      ⁡                                              (                        v                        )                                                                              ·                                      X                    ⁡                                          (                                              u                        ,                        v                                            )                                                                      ⁢                                  xe2x80x83                                ⁢                                  cos                  (                                      xe2x80x83                                    ⁢                                                            (                                                                        2                          ⁢                          i                                                +                        1                                            )                                        ⁢                                          xe2x80x83                                        ⁢                    u                    ⁢                                          xe2x80x83                                        ⁢                                          π                      /                      2                                        ⁢                    N                                    )                                ⁢                                  xe2x80x83                                ⁢                                  cos                  (                                      xe2x80x83                                    ⁢                                                            (                                                                        2                          ⁢                          j                                                +                        1                                            )                                        ⁢                    v                    ⁢                                          xe2x80x83                                        ⁢                                          π                      /                      2                                        ⁢                    N                                    )                                                                                        formula        ⁢                  xe2x80x83                ⁢                  (          2          )                    
Further, formula (3) defines one-dimensional DCT which is derived from formulae (1) and (2).                               X          ⁡                      (            u            )                          =                                            2              /              N                                ·                      C            ⁡                          (              u              )                                ·                                    ∑                              i                =                0                                            N                -                1                                      ⁢                          xe2x80x83                        ⁢                                          x                ⁡                                  (                  i                  )                                            ⁢                              cos                ⁡                                  (                                                            (                                                                        2                          ⁢                          i                                                +                        1                                            )                                        ⁢                    u                    ⁢                                          xe2x80x83                                        ⁢                                          π                      /                      2                                        ⁢                    N                                    )                                                                                        formula        ⁢                  xe2x80x83                ⁢                  (          3          )                    
In these formulae, x(i,j) (i,j=0,1,2, . . . ,Nxe2x88x921) indicates pixels, and X(u,v) (C(0)=1/{square root over ( )}2, C(u)=C(v)=1 (u,v=1,2, . . . ,Nxe2x88x921)) indicates transform coefficients.
When N=8, the matrix operation of the one-dimensional DCT matrix according to formula (3) is represented by                               **N=8**                ⁢                  xe2x80x83                                    xe2x80x83                                          (                                                    X0                                                                    X1                                                                    X2                                                                    X3                                                                    X4                                                                    X5                                                                    X6                                                                    X7                                              )                =                              (                                                            0.353553                                                  0.353553                                                  0.353553                                                  0.353553                                                  0.353553                                                  0.353553                                                  0.353553                                                  0.353553                                                                              0.490393                                                  0.415735                                                  0.277785                                                  0.097545                                                                      -                    0.097545                                                                                        -                    0.277785                                                                                        -                    0.415735                                                                                        -                    0.490393                                                                                                0.461940                                                  0.191342                                                                      -                    0.191342                                                                                        -                    0.461940                                                                                        -                    0.461940                                                                                        -                    0.191342                                                                    0.191342                                                  0.461940                                                                              0.415735                                                                      -                    0.097545                                                                                        -                    0.490393                                                                                        -                    0.277785                                                                    0.277785                                                  0.490393                                                  0.097545                                                                      -                    0.415735                                                                                                0.353553                                                                      -                    0.353553                                                                                        -                    0.353553                                                                    0.353553                                                  0.353553                                                                      -                    0.353553                                                                                        -                    0.353553                                                                    0.353553                                                                              0.277785                                                                      -                    0.490393                                                                    0.097545                                                  0.415735                                                                      -                    0.415735                                                                                        -                    0.097545                                                                    0.490393                                                                      -                    0.277785                                                                                                0.191342                                                                      -                    0.461940                                                                    0.461940                                                                      -                    0.191342                                                                                        -                    0.191342                                                                    0.461940                                                                      -                    0.461940                                                                    0.191342                                                                              0.097545                                                                      -                    0.277785                                                                    0.415735                                                                      -                    0.490393                                                                    0.490393                                                                      -                    0.415735                                                                    0.277785                                                                      -                    0.097545                                                                        )                    ⁢                      (                                                            x0                                                                              x1                                                                              x2                                                                              x3                                                                              x4                                                                              x5                                                                              x6                                                                              x7                                                      )                                              formula        ⁢                  xe2x80x83                ⁢                  (          4          )                    
When N=7, N=6, N=5, N=4, N=3, N=2, the matrix operations of the one-dimensional DCT are represented by                               **N=7**                ⁢                  xe2x80x83                                    xe2x80x83                                          (                                                    X0                                                                    X1                                                                    X2                                                                    X3                                                                    X4                                                                    X5                                                                    X6                                              )                =                              (                                                            0.377964                                                  0.377964                                                  0.377964                                                  0.377964                                                  0.377964                                                  0.377964                                                  0.377964                                                                              0.521121                                                  0.417907                                                  0.231921                                                  0.000000                                                                      -                    0.231921                                                                                        -                    0.417907                                                                                        -                    0.521121                                                                                                0.481588                                                  0.118942                                                                      -                    0.333269                                                                                        -                    0.534522                                                                                        -                    0.333269                                                                    0.118942                                                  0.481588                                                                              0.417907                                                                      -                    0.231921                                                                                        -                    0.521121                                                                                        -                    0.000000                                                                    0.521121                                                  0.231921                                                                      -                    0.417907                                                                                                0.333269                                                                      -                    0.481588                                                                                        -                    0.118942                                                                    0.534522                                                                      -                    0.118942                                                                                        -                    0.481588                                                                    0.333269                                                                              0.231921                                                                      -                    0.521121                                                                    0.417907                                                  0.000000                                                                      -                    0.417907                                                                    0.521121                                                                      -                    0.231921                                                                                                0.118942                                                                      -                    0.333269                                                                    0.481588                                                                      -                    0.534522                                                                    0.481588                                                                      -                    0.333269                                                                    0.118942                                                      )                    ⁢                      (                                                            x0                                                                              x1                                                                              x2                                                                              x3                                                                              x4                                                                              x5                                                                              x6                                                      )                                              formula        ⁢                  xe2x80x83                ⁢                  (          5          )                                                  **N=6**                ⁢                  xe2x80x83                                    xe2x80x83                                          (                                                    X0                                                                    X1                                                                    X2                                                                    X3                                                                    X4                                                                    X5                                              )                =                              (                                                            0.408248                                                  0.408248                                                  0.408248                                                  0.408248                                                  0.408248                                                  0.408248                                                                              0.557678                                                  0.408248                                                  0.149429                                                                      -                    0.149429                                                                                        -                    0.408248                                                                                        -                    0.557678                                                                                                0.500000                                                  0.000000                                                                      -                    0.500000                                                                                        -                    0.500000                                                                                        -                    0.000000                                                                    0.500000                                                                              0.408248                                                                      -                    0.408248                                                                                        -                    0.408248                                                                    0.408248                                                  0.408248                                                                      -                    0.408248                                                                                                0.288675                                                                      -                    0.577350                                                                    0.288675                                                  0.288675                                                                      -                    0.577350                                                                    0.288675                                                                              0.149429                                                                      -                    0.408248                                                                    0.557678                                                                      -                    0.577678                                                                    0.408248                                                                      -                    0.149429                                                                        )                    ⁢                      (                                                            x0                                                                              x1                                                                              x2                                                                              x3                                                                              x4                                                                              x5                                                      )                                              formula        ⁢                  xe2x80x83                ⁢                  (          6          )                                                  **N=5**                ⁢                  xe2x80x83                                    xe2x80x83                                          (                                                    X0                                                                    X1                                                                    X2                                                                    X3                                                                    X4                                              )                =                              (                                                            0.447214                                                  0.447214                                                  0.447214                                                  0.447214                                                  0.447214                                                                              0.601501                                                  0.371748                                                  0.000000                                                                      -                    0.371748                                                                                        -                    0.601501                                                                                                0.511667                                                                      -                    0.195440                                                                                        -                    0.632456                                                                                        -                    0.195440                                                                    0.511667                                                                              0.371748                                                                      -                    0.601501                                                                                        -                    0.000000                                                                    0.601501                                                                      -                    0.371748                                                                                                0.195440                                                                      -                    0.511667                                                                    0.632456                                                                      -                    0.511667                                                                    0.195440                                                      )                    ⁢                      (                                                            x0                                                                              x1                                                                              x2                                                                              x3                                                                              x4                                                      )                                              formula        ⁢                  xe2x80x83                ⁢                  (          7          )                                                  **N=4**                ⁢                  xe2x80x83                                    xe2x80x83                                          (                                                    X0                                                                    X1                                                                    X2                                                                    X3                                              )                =                              (                                                            0.500000                                                  0.500000                                                  0.500000                                                  0.500000                                                                              0.635281                                                  0.270598                                                                      -                    0.270598                                                                                        -                    0.635281                                                                                                0.500000                                                                      -                    0.500000                                                                                        -                    0.500000                                                                    0.500000                                                                              0.270598                                                                      -                    0.635281                                                                    0.635281                                                                      -                    0.270598                                                                        )                    ⁢                      (                                                            x0                                                                              x1                                                                              x2                                                                              x3                                                      )                                              formula        ⁢                  xe2x80x83                ⁢                  (          8          )                                                  **N=3**                ⁢                  xe2x80x83                                    xe2x80x83                                          (                                                    X0                                                                    X1                                                                    X2                                              )                =                              (                                                            0.577350                                                  0.707107                                                  0.408248                                                                              0.577350                                                  0.000000                                                                      -                    0.816497                                                                                                0.577350                                                                      -                    0.707107                                                                    0.408248                                                      )                    ⁢                      (                                                            x0                                                                              x1                                                                              x2                                                      )                                              formula        ⁢                  xe2x80x83                ⁢                  (          9          )                                                  **N=2**                ⁢                  xe2x80x83                                    xe2x80x83                                          (                                                    X0                                                                    X1                                              )                =                              (                                                            0.707107                                                  0.707107                                                                              0.707107                                                                      -                    0.707107                                                                        )                    ⁢                      (                                                            x0                                                                              x1                                                      )                                              formula        ⁢                  xe2x80x83                ⁢                  (          10          )                    
On the other hand, the matrix operation of the one-dimensional inverse DCT in the case where N=8 is represented by                               **N=8**                ⁢                  xe2x80x83                                    xe2x80x83                                          (                                                    x0                                                                    x1                                                                    x2                                                                    x3                                                                    x4                                                                    x5                                                                    x6                                                                    x7                                              )                =                              (                                                            0.353553                                                  0.490393                                                  0.461940                                                  0.415735                                                  0.353553                                                  0.277785                                                  0.191342                                                  0.097545                                                                              0.353553                                                  0.415735                                                  0.191342                                                                      -                    0.097545                                                                                        -                    0.353553                                                                                        -                    0.490393                                                                                        -                    0.461940                                                                                        -                    0.277785                                                                                                0.353553                                                  0.277785                                                                      -                    0.191342                                                                                        -                    0.490393                                                                                        -                    0.353553                                                                    0.097545                                                  0.461940                                                  0.415735                                                                              0.353553                                                  0.097545                                                                      -                    0.461940                                                                                        -                    0.277785                                                                    0.353553                                                  0.415735                                                                      -                    0.191342                                                                                        -                    0.490393                                                                                                0.353553                                                                      -                    0.097545                                                                                        -                    0.461940                                                                    0.277785                                                  0.353553                                                                      -                    0.415735                                                                                        -                    0.191342                                                                    0.490393                                                                              0.353553                                                                      -                    0.277785                                                                                        -                    0.191342                                                                    0.490393                                                                      -                    0.353553                                                                                        -                    0.097545                                                                    0.461940                                                                      -                    0.415735                                                                                                0.353553                                                                      -                    0.415735                                                                    0.191342                                                  0.097545                                                                      -                    0.353553                                                                    0.490393                                                                      -                    0.461940                                                                    0.277785                                                                              0.353553                                                                      -                    0.490393                                                                    0.461940                                                                      -                    0.415735                                                                    0.353553                                                                      -                    0.277785                                                                    0.191342                                                                      -                    0.097545                                                                        )                    ⁢                      (                                                            X0                                                                              X1                                                                              X2                                                                              X3                                                                              X4                                                                              X5                                                                              X6                                                                              X7                                                      )                                                        formula          ⁢                      xe2x80x83                    ⁢                      (            11            )                          ⁢                  xe2x80x83                    
When N=7, N=6, N=5, N=4, N=3, and N=2, the matrix operations of the one-dimensional inverse DCT are represented by                               **N=7**                ⁢                  xe2x80x83                                    xe2x80x83                                          (                                                    x0                                                                    x1                                                                    x2                                                                    x3                                                                    x4                                                                    x5                                                                    x6                                              )                =                              (                                                            0.377964                                                  0.521121                                                  0.481588                                                  0.417907                                                  0.333269                                                  0.231921                                                  0.118942                                                                              0.377964                                                  0.417907                                                  0.118942                                                                      -                    0.231921                                                                                        -                    0.481588                                                                                        -                    0.521121                                                                                        -                    0.333269                                                                                                0.377964                                                  0.231921                                                                      -                    0.333269                                                                                        -                    0.521121                                                                                        -                    0.118942                                                                    0.417907                                                  0.481588                                                                              0.377964                                                  0.000000                                                                      -                    0.534522                                                                                        -                    0.000000                                                                    0.534522                                                  0.000000                                                                      -                    0.534522                                                                                                0.377964                                                                      -                    0.231921                                                                                        -                    0.333269                                                                    0.521121                                                                      -                    0.118942                                                                                        -                    0.417907                                                                    0.481588                                                                              0.377964                                                                      -                    0.417907                                                                    0.118942                                                  0.231921                                                                      -                    0.481588                                                                    0.521121                                                                      -                    0.333269                                                                                                0.377964                                                                      -                    0.521121                                                                    0.481588                                                                      -                    0.417907                                                                    0.333269                                                                      -                    0.231921                                                                    0.118942                                                      )                    ⁢                      (                                                            X0                                                                              X1                                                                              X2                                                                              X3                                                                              X4                                                                              X5                                                                              X6                                                      )                                              formula        ⁢                  xe2x80x83                ⁢                  (          12          )                                                  **N=6**                ⁢                  xe2x80x83                                    xe2x80x83                                          (                                                    x0                                                                    x1                                                                    x2                                                                    x3                                                                    x4                                                                    x5                                              )                =                              (                                                            0.408248                                                  0.557678                                                  0.500000                                                  0.408248                                                  0.288675                                                  0.149429                                                                              0.408248                                                  0.408248                                                  0.000000                                                                      -                    0.408248                                                                                        -                    0.577350                                                                                        -                    0.408248                                                                                                0.408248                                                  0.149429                                                                      -                    0.500000                                                                                        -                    0.408248                                                                    0.288675                                                  0.557678                                                                              0.408248                                                                      -                    0.149429                                                                                        -                    0.500000                                                                    0.408248                                                  0.288675                                                                      -                    0.577678                                                                                                0.408248                                                                      -                    0.408248                                                                                        -                    0.000000                                                                    0.408248                                                                      -                    0.577350                                                                    0.408248                                                                              0.408248                                                                      -                    0.557678                                                                    0.500000                                                                      -                    0.408248                                                                    0.288675                                                                      -                    0.149429                                                                        )                    ⁢                      (                                                            X0                                                                              X1                                                                              X2                                                                              X3                                                                              X4                                                                              X5                                                      )                                              formula        ⁢                  xe2x80x83                ⁢                  (          13          )                                                  **N=5**                ⁢                  xe2x80x83                                    xe2x80x83                                          (                                                    x0                                                                    x1                                                                    x2                                                                    x3                                                                    x4                                              )                =                              (                                                            0.447214                                                  0.601501                                                  0.511667                                                  0.371748                                                  0.195440                                                                              0.447214                                                  0.371748                                                                      -                    0.195440                                                                                        -                    0.601501                                                                                        -                    0.511667                                                                                                0.447214                                                  0.000000                                                                      -                    0.632456                                                                                        -                    0.000000                                                                    0.632456                                                                              0.447214                                                                      -                    0.371748                                                                                        -                    0.195440                                                                    0.601501                                                                      -                    0.511667                                                                                                0.447214                                                                      -                    0.601501                                                                    0.511667                                                                      -                    0.371748                                                                    0.195440                                                      )                    ⁢                      (                                                            X0                                                                              X1                                                                              X2                                                                              X3                                                                              X4                                                      )                                              formula        ⁢                  xe2x80x83                ⁢                  (          14          )                                                  **N=4**                ⁢                  xe2x80x83                                    xe2x80x83                                          (                                                    x0                                                                    x1                                                                    x2                                                                    x3                                              )                =                              (                                                            0.500000                                                  0.635281                                                  0.500000                                                  0.270598                                                                              0.500000                                                  0.270598                                                                      -                    0.500000                                                                                        -                    0.635281                                                                                                0.500000                                                                      -                    0.270598                                                                                        -                    0.500000                                                                    0.635281                                                                              0.500000                                                                      -                    0.635281                                                                    0.500000                                                                      -                    0.270598                                                                        )                    ⁢                      xe2x80x83                    ⁢                      (                                                            X0                                                                              X1                                                                              X2                                                                              X3                                                      )                                              formula        ⁢                  xe2x80x83                ⁢                  (          15          )                                                  **N=3**                ⁢                  xe2x80x83                                    xe2x80x83                                          (                                                    x0                                                                    x1                                                                    x2                                              )                =                              (                                                            0.577350                                                  0.707107                                                  0.408248                                                                              0.577350                                                  0.000000                                                                      -                    0.816497                                                                                                0.577350                                                                      -                    0.707107                                                                    0.408248                                                      )                    ⁢                      (                                                            X0                                                                              X1                                                                              X2                                                      )                                              formula        ⁢                  xe2x80x83                ⁢                  (          16          )                                                  **N=2**                ⁢                  xe2x80x83                                    xe2x80x83                                          (                                                    x0                                                                    x1                                              )                =                              (                                                            0.707107                                                  0.707107                                                                              0.707107                                                                      -                    0.707107                                                                        )                    ⁢                      (                                                            X0                                                                              X1                                                      )                                              formula        ⁢                  xe2x80x83                ⁢                  (          17          )                    
FIG. 8 is a block diagram for explaining an example of a conventional DCT processor, illustrating the structure of the DCT processor. In FIG. 8, a DCT processor 1 comprises 8-bit input registers 2a, 2b, 2c, 2d, 2e, 2f, 2g and 2h for latching input image data; 8-bit holding registers 3a, 3b, 3c, 3d, 3e, 3f, 3g and 3h for latching the output data from the respective input registers 2a, 2b, 2c, 2d, 2e, 2f, 2g and 2h and, thereafter, shift-outputting the data, bit by bit, from the least significant bit (hereinafter referred to as xe2x80x9cLSBxe2x80x9d) of each output data; ROM accumulators (hereinafter referred to as xe2x80x9cRACxe2x80x9d) 4a, 4b, 4c, 4d, 4e, 4f, 4g and 4h for accumulating the data in ROMs (Read Only Memories) 41axcx9c41h by accumulators 42axcx9c42h, with the output data from the respective holding registers 3a, 3b, 3c, 3d, 3e, 3g, 3g and 3h as 8-bit addresses; and output registers 5a, 5b, 5c, 5d, 5e, 5f, 5g and 5h for latching the output data from the respective RACs 4a, 4b, 4c, 4d, 4e, 4f, 4g and 4h and outputting these data.
Further, the respective RACs 4a, 4b, 4c, 4d, 4e, 4f, 4g and 4h comprise ROMs 41axcx9c41h each having a table of 28 data including the sum of the products obtained by multiplying the column coefficients in the matrix operation by the respective bits of the pixel data constituting the input column or row; and accumulators 42axcx9c42h for accumulating the outputs from the respective ROMs 41axcx9c41h. 
The conventional DCT processor employs the DA (Distributed Arithmetic) method for the matrix operation. This DA method is efficient for the product-sum operation of fixed coefficients. In this method, the product-sum operation between each input pixel data and the fixed coefficients is performed not in word units but in bit string units. A bit string comprising the bits of each input pixel data is used as an address, and the partial product corresponding to this address is read from the ROM which stores the partial products as a table, and the bits from the LSB (Least Significant Bit) to the MSB (Most Significant Bit) are accumulated to realize the product-sum operation of fixed coefficients. In this DCT processor, the partial products obtained by multiplying the bit strings constituted by the respective bits of the input pixel data of N or M pixels by the row coefficients of the DCT coefficients are stored as tables in the respective ROMs 41axcx9c41h of the RACs 4axcx9c4h, in association with the respective row coefficients of the DCT coefficients. By inputting the bit strings of N or M bits constituted by the respective bits of the input pixel data of N or M pixels as addresses in the respective ROMs 41axcx9c41h, the partial products are output from the ROMs 41axcx9c41h, and these partial products are sequentially output from the LSB to the MSB of the respective pixel data, and accumulated, whereby the result of the one-dimensional DCT is obtained.
Next, the operation will be described.
Initially, the input register 2a latches 8-bit input pixel data, and shift operation is performed in every input cycle, from the input register 2a to the input register 2b, from the input register 2b to the input register 2c, . . . , until the pixel data is latched by all of the input registers 2a, 2b, 2c, 2d, 2e, 2f, 2g, and 2h. Thereafter, the input registers 2a, 2b, 2c, 2d, 2e, 2f, 2g, and 2h output the latched pixel data to the corresponding holding registers 3a, 3b, 3c, 3d, 3e, 3f, 3g, and 3h. In parallel with the next 8 pieces of input pixel data being latched by the input registers 2a, 2b, 2c, 2d, 2e, 2f, 2g, and 2h, the holding registers 3a, 3b, 3c, 3d, 3e, 3f, 3g, and 3h output the latched 8-bit pixel data, bit by bit, from the LSB. With the 8-bit data outputted from the holding registers 3a, 3b, 3c, 3d, 3e, 3f, 3g, and 3h as addresses, the ROMs 41a, 41b, 41c, 41d, 41e, 41f, 41g, and 41h output ROM data corresponding to these addresses. The accumulators 42a, 42b, 42c, 42d, 42e, 42f, 42g, and 42h latch the 8-bit ROM data outputted from the corresponding ROMs 41a, 41b, 41x, 41d, 41e, 41f, 41g, and 41h, and output 8-bit data. The output registers 5a, 5b, 5c, 5d, 5e, 5f, 5g, and 5h corresponding to the RACs 4a, 4b, 4c, 4d, 4e, 4f, 4g, and 4h latch the data outputted from the accumulators 42a, 42b, 42c, 42d, 42e, 42f, 42g, and 42h, respectively, and perform sequential shift operation from the output register 5h to the output register 5g, from the output register 5g to the output register 5f, . . . , to output the latched data.
When performing two-dimensional DCT on pixel data in a unit block comprising 8xc3x978 pixels by using the DCT processor 1, initially, a series of operations are performed eight times for every eight pieces of pixel data in the column direction to obtain 64 interim results and, thereafter, one-dimensional DCT is performed on the 64 interim results in the row direction.
However, in order to perform one-dimensional DCT or inverse DCT on a unit block comprising 8xc3x978 pixels, the conventional DCT processor should have 8 tables each containing 256 pieces of ROM data when each input pixel data has 8 bits. When both of DCT and inverse DCT are performed by one DCT processor, the processor should have 8 tables each having 512 pieces of ROM data. Further, in recent years, there is a demand for variable size of a unit block, depending on the standard of video data compression. However, the above-described DCT processor is applicable to only pixel data having 8xc3x978 pixels as a unit block. So, in order to process pixel data having, as a unit block, 7xc3x977 pixels, 6xc3x976 pixels, 5xc3x975 pixels, and 4xc3x974 pixels, DCT processors having 7 tables of 256 pieces of ROM data, six tables of 128 pieces of ROM data, five tables of 64 pieces of ROM data, and four tables of 32 pieces of ROM data are required, respectively. Accordingly, in order to perform DCT and inverse DCT on pixel data in unit blocks each comprising arbitrarily selected Nxc3x97M pixels, a plurality of DCT processors are required, whereby the circuit scale is considerably increased.
The present invention is made to solve the above-described problems and it is an object of the present invention to provide a DCT processor having a relatively small circuit scale, which can perform DCT or inverse DCT on image data in unit blocks having different sizes.
The present invention is a DCT processor performing one-dimensional DCT operation or one-dimensional inverse DCT operation on pixel data of image data in unit blocks each comprising Nxc3x97M pixels (N,M: arbitrary integers from 1 to 8). This DCT processor comprises: bit slice means for receiving the pixel data of the image data in each Nxc3x97M unit block for each row or column, and slicing, bit by bit, the respective pixel data constituting the input rows or columns, and outputting the sliced pixel data; control means for outputting a control signal which includes the number of input pixel data that is the number of pixel data constituting each input row or column, and a value indicating that either the DCT operation or the inverse DCT operation is to be performed; first butterfly operation means for subjecting the output data from the bit slice means to the butterfly operation and outputting the result of the butterfly operation in the case where the control signal outputted from the control means indicates that the number of input pixel data is a power of 2 and that the DCT operation is to be performed, and in the cases other than mentioned above, the first butterfly operation means performing no butterfly operation and outputting the output data of the bit slice means as it is; address generation means for generating addresses on the basis of bit strings obtained from the output data of the first butterfly operation means, and the number of input pixel data and the value indicating that either the DCT operation or the inverse DCT operation is to be performed, which are included in the control signal; operation means having eight sets of multiplication result output means and accumulation means, the multiplication result output means outputting the results of multiplication to be used for obtaining the results of the one-dimensional DCT and inverse DCT operations, in accordance with the above-described addresses, and the accumulation means accumulating the output data from the multiplication result output means and outputting the accumulated data; and second butterfly operation means for subjecting the output data from the operation means to the butterfly operation and outputting the result of the butterfly operation after rearranging it according to the order of input pixel data in the case where the control signal outputted from the control means indicates that the number of input pixel data is a power of 2 and that the inverse DCT operation is to be performed, and in the cases other than mentioned above, the second butterfly operation means performing no butterfly operation and outputting the output data of the operation means after rearranging it according to the order of input pixel data. Therefore, the quantity of data to be the result of multiplication used for obtaining the result of DCT operation and the result of inverse DCT operation is reduced, whereby the data capacity of the multiplication result output means for outputting this data is reduced, resulting in a DCT processor having reduced circuit scale.
Further, in the present invention, on the basis of the output data from the first butterfly operation means, and the number of input pixel data, and the value indicating that either the DCT operation or the inverse DCT operation is to be performed, the address generation means generates addresses as follows. When the control signal indicates that the number of input pixel data is any of 7, 6, 5, and 3, the address generation means generates an address by adding a header address of 2 bits, 3 bits, 4 bits, or 6 bits which indicates the value of the number of input pixel data including the value indicating either the DCT operation or the inverse DCT operation, to a bit string of 7 bits, 6 bits, 5 bits, or 3 bits which is constituted based on the output data from the first butterfly operation means, respectively. When the control signal indicates that the number of input pixel data is any of 8, 4, and 2 and the DCT operation is to be performed, the address generation means generates an address by adding a header address of 5 bits, 7 bits, or 8 bits which indicates the value of the number of input pixel data including the value indicating that the DCT operation is to be performed, to a bit string of 4 bits, 2 bits, or 1 bit which is constituted based on the result of addition obtained in the butterfly operation by the butterfly operation means, and to a bit string of 4 bits, 2 bits, or 1 bit which is constituted based on the result of subtraction obtained in the butterfly operation, respectively. When the control signal indicates that the number of input pixel data is any of 8, 4, and 2 and the inverse DCT operation is to be performed, the address generation means generates an address by adding a header address of 5 bits, 7 bits, or 8 bits which indicates the value of the number of input pixel data including the value indicating that the inverse DCT operation is to be performed, to a bit string of 4 bits, 2 bits, or 1 bit which is constituted based on the output of 8 bits, 4 bits, or 2 bits from the first butterfly operation means, respectively. The header addresses are bit strings which permit all of the addresses obtained by adding the header addresses to the addresses based on the output data from the first butterfly operation means, to become continuous addresses. Therefore, the multiplication result output means can be efficiently mapped so that no useless area is generated in the multiplication result output means, and thus the size of the multiplication result output means is reduced, whereby the circuit scale of the DCT processor is further reduced.
Further, in the present invention, the multiplication result output means outputs the results of multiplication as follows. When the control signal outputted from the control means indicates that the number of input pixel data is a power of 2 and the DCT operation is to be performed, the multiplication result output means outputs the result of multiplication with respect to the bit strings obtained from the output data of the first butterfly operation means, according to the DCT matrix operation using fast Fourier transform. When the control signal outputted from the control means indicates that the number of input pixel data is a value other than a power of 2 and the DCT operation is to be performed, the multiplication result output means outputs the result of multiplication with respect to the bit strings obtained from the output data of the first butterfly operation means, according to the DCT matrix operation. When the control signal outputted from the control means indicates that the number of input pixel data is a power of 2 and the inverse DCT operation is to be performed, the multiplication result output means outputs the result of multiplication with respect to the bit strings obtained from the output data of the first butterfly operation means, according to the inverse DCT matrix operation using fast Fourier transform. When the control signal outputted from the control means indicates that the number of input pixel data is a value other than a power of 2 and the inverse DCT operation is to be performed, the multiplication result output means outputs the result of multiplication with respect to the bit strings obtained from the output data of the first butterfly operation means, according to the inverse DCT matrix operation. Therefore, the circuit scale of the DCT processor is further reduced.
Further, in the present invention, when the control signal indicates that the number of input pixel data is a value other than 8, the operation of means which is not used for the operation is halted. Therefore, the power consumption is reduced.
Further, the present invention is a DCT processor performing one-dimensional DCT operation on pixel data of image data in unit blocks each comprising Nxc3x97M pixels (N,M: arbitrary integers not less than 1). This DCT processor comprises: bit slice means for receiving the pixel data of the image data in each Nxc3x97M unit block for each row or column, and slicing, bit by bit, the respective pixel data constituting the input rows or columns, and outputting the sliced pixel data; control means for outputting a control signal which indicates the number of input pixel data that is the number of pixel data constituting each input row or column; butterfly operation means for performing butterfly operation on the output data from the bit slice means and outputting the result of the butterfly operation in the case where the control signal outputted from the control means indicates that the number of input pixel data is a power of 2, and in the cases other than mentioned above, the butterfly operation means performing no butterfly operation and outputting the output data of the bit slice means as it is; address generation means for generating. addresses by using bit strings obtained from the output data of the first butterfly operation means, and the number of input pixel data included in the control signal; operation means having plural sets of multiplication result output means and accumulation circuits, as many as the maximum value of the number of input pixel data, the multiplication result output means outputting the results of multiplication to be used for obtaining the result of one-dimensional DCT operation,. in accordance with the above-described addresses, and the accumulation circuits accumulating the results of multiplication outputted from the respective multiplication result output means and outputting the accumulated results; and output means for rearranging the output data of the operation means according to the order of input pixel data, and outputting the rearranged data as the result of one-dimensional DCT operation. Therefore, the quantity of data to be the result of multiplication used for obtaining the result of DCT operation is reduced, whereby the data capacity of the multiplication result output means for outputting this data is reduced, resulting in a DCT processor having reduced circuit scale.
Further, in the present invention, on the basis of the output data from the first butterfly operation means and the number of input pixel data, the address generation means generates addresses as follows. When the control signal indicates that the number of input pixel data is a value other than a power of 2, the address generation means generates an address by adding a header address for indicating the number of input pixel data, to an address having the number of bits equal to the number of input pixel data, which is constituted based on the output data from the first butterfly operation means. When the control signal indicates that the number of input pixel data is a power of 2, the address generation means generates an address by adding a header address for indicating the number of input pixel data, to a bit string having the number of bits equal to half of the number of input pixel data, which is constituted based on the result of the addition obtained in the butterfly operation by the first butterfly operation means, and to a bit string having the number of bits equal to half of the number of input pixel data, which is constituted based on the result of the subtraction obtained in the butterfly operation. The header addresses are bit strings which permit all of the addresses obtained by adding the header addresses to the addresses based on the output data from the first butterfly operation means, to become continuous addresses and have the number of bits equal to the maximum value of the number of input pixel data. Therefore, the multiplication result output means can be efficiently mapped so that no useless area is generated in the multiplication result output means, and thus the size of the multiplication result output means is reduced, whereby the circuit scale of the DCT processor is further reduced.
Further, in the present invention, the butterfly operation means performs butterfly operation for outputting the values obtained by sequentially adding and subtracting the pixel data, which have been input for each row or column to the bit slice means and sliced bit by bit to be output, starting from the both ends of the input row or column toward the inside. Therefore, the circuit scale of the DCT processor is further reduced.
Further, in the present invention, the multiplication result output means outputs the result of multiplication as follows. When the control signal outputted from the control means indicates that the number of input pixel data is a power of 2, the multiplication result output means outputs the result of multiplication with respect to the bit strings obtained from the output data of the first butterfly operation means according to the DCT matrix operation using fast Fourier transform. When the control signal indicates that the number of input pixel data is a value other than a power of 2, the multiplication result output means outputs the result of multiplication with respect to the bit strings obtained from the output data of the first butterfly operation means according to the DCT matrix operation. Therefore, the circuit scale of the DCT processor is further reduced.
Further, the present invention is a DCT processor performing one-dimensional inverse DCT operation on pixel data of image data in unit blocks each comprising Nxc3x97M pixels (N,M: arbitrary integers not less than 1). This DCT processor comprises: bit slice means for receiving the pixel data of the image data in each Nxc3x97M unit block for each row or column, and slicing, bit by bit, the respective pixel data constituting the input rows or columns, and outputting the sliced pixel data; control means for outputting a control signal which includes the number of input pixel data that is the number of pixel data constituting each input row or column; address generation means for generating addresses using bit strings obtained from the output data of the bit slice means, and the number of input pixel data included in the control signal; operation means having plural sets of multiplication result output means and accumulation circuits, as many as the maximum value of the number of input pixel data, the multiplication result output means outputting the results of multiplication to be used for obtaining the result of one-dimensional DCT operation in accordance with the above-described addresses, and the accumulation circuits accumulating the results of multiplication outputted from the respective multiplication result output means and outputting the accumulated results; and butterfly operation means for performing butterfly operation on the output data from the operation means and outputting the result of the butterfly operation after rearranging it according to the order of input pixel data in the case where the control signal outputted from the control means indicates that the number of input pixel data is a power of 2, and in the cases other than mentioned above, the butterfly operation means performing no butterfly operation and outputting the output data of the operation means after rearranging it according to the order of input pixel data. Therefore, the quantity of data to be the result of multiplication used for obtaining the result of inverse DCT operation is reduced, whereby the data capacity of the multiplication result output means for outputting this data is reduced, resulting in a DCT processor having reduced circuit scale.
Further, in the present invention, on the basis of the output data from the bit slice means and the number of input pixel data, the address generation means generates addresses as follows. When the control signal indicates that the number of input pixel data is a value other than a power of 2, the address generation means generates an address by adding a header address for indicating the number of input pixel data, to an address having the number of bits equal to the number of input pixel data, which is constituted based on the output data of the bit slice means. When the control signal indicates that the number of input pixel data is a power of 2, the address generation means generates an address by adding a header address for indicating the number of input pixel data, to a bit string having the number of bits equal to half of the number of input pixel data, which is constituted based on the output data from the bit slice means. The header addresses are bit strings which permit all of the addresses obtained by adding the header addresses to the addresses based on the output data of the bit slice means to become continuous addresses and have the number of bits equal to the maximum value of the number of input pixel data constituting the input row or column. Therefore, the multiplication result output means can be efficiently mapped so that no useless area is generated in the multiplication result output means, and thus the size of the multiplication result output means is reduced, whereby the circuit scale of the DCT processor is further reduced.
Further, in the present invention, the butterfly operation, means performs butterfly operation for outputting the value obtained by addition and the value obtained by subtraction, which addition and subtraction are performed between the value obtained by accumulating the result of multiplication based on the odd-numbered pixel data amongst the pixel data input for each row or column, and the value obtained by accumulating the result of multiplication based on the even-numbered pixel data. Therefore, the circuit scale of the DCT processor is further reduced.
Further, in the present invention, the multiplication result output means outputs the result of multiplication as follows. When the control signal outputted from the control means indicates that the number of input pixel data is a power of 2, the multiplication result output means outputs the result of multiplication with respect to the bit strings obtained from the output data of the first butterfly operation means according to the inverse DCT matrix operation using fast Fourier transform. When the control signal indicates that the number of input pixel data is a value other than a power of 2, the multiplication result output means outputs the result of multiplication with respect to the bit strings obtained from the output data of the first butterfly operation means according to the inverse DCT matrix operation. Therefore, the circuit scale of the DCT processor is further reduced.
Further, in the present invention, the unit block of the image data to be input to the bit slice means is a unit block each comprising Nxc3x97M pixels (N,M: arbitrary integers from 1 to 8); and the operation means includes eight sets of multiplication result output means and accumulation means, which is equal to the maximum value of the number of input pixel data. Therefore, the circuit scale of the DCT processor is further reduced.
Further, in the present invention, the bit slice means receives 16-bit data as each pixel data to be input, slices this 16-bit data for every two bits, and outputs the sliced data; and the operation means is provided with, as each of the multiplication result output means, two multiplication result output units placed in parallel with each other, each outputting the result of multiplication, and data obtained by adding the outputs of the two multiplication result output units is accumulated by the corresponding accumulation means. Therefore, the circuit scale of the DCT processor is further reduced when the input pixel data is 16-bit data.
Further, in the present invention, when the control signal indicates that the number of input pixel data is equal to a value other than the maximum value of the number of input pixel data, the operation of means to be unused is halted. Therefore, the power consumption is reduced.